How to find duplicate characters in a string in Java